#include"MySvgWidget.h"
#include<QDebug>

MySvgWidget::MySvgWidget(const QString& filepath,QWidget* parent)
    :QWidget(parent),render(new QSvgRenderer(this)) {
    if(!render->load(filepath)) {
        qDebug() << "svg文件加载失败 !";
    }
    this->setWindowTitle("custom window for svg");
}

MySvgWidget::~MySvgWidget() {

}

void MySvgWidget::paintEvent(QPaintEvent *event) {
    QPainter painter(this);
    render->render(&painter);
}
